package com.yupi.springbootinit.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author gan
 * @date 2023/5/12 9:56
 */
public class FormatConversionUtils {
    /**
     * 将 map 中的值的转成字符串
     */
    public static Map<String,String> valueToString(Map<String, Object> userMap){
        Map<String,String> res = new HashMap<>();
        for (String key : userMap.keySet()) {
            if (userMap.get(key) == null)
                res.put(key,null);
            else
                res.put(key,userMap.get(key).toString());
        }
        return res;
    }
}
